package co.fitstart.mobile.service;

import java.util.List;

import com.demo2do.core.service.GenericService;
import com.demo2do.core.support.Result;

import co.fitstart.entity.coupon.Coupon;
import co.fitstart.entity.coupon.CouponBatch;
import co.fitstart.entity.coupon.CouponTemplate;
import co.fitstart.entity.order.Order;
import co.fitstart.entity.product.Product;
import co.fitstart.entity.user.User;

/**
 * 
 * @author mohanlan
 *
 */
public interface CouponService extends GenericService<Coupon> {

    /**
     * 
     * @param templateIds
     * @return
     */
    public List<CouponTemplate> listCouponTemplates(List<Long> templateIds);
    
    /**
     * 
     * @param batchIds
     * @return
     */
    public List<CouponBatch> listCouponBatch(List<Long> batchIds);

    /**
     * 
     * @param user
     * @param couponBatchs
     */
    public void createCoupons(User user, List<CouponBatch> couponBatchs);
    
    /**
     * 
     * @param mobile
     * @param couponBatchs
     */
    public void createCoupons(String mobile, List<CouponBatch> couponBatchs);
    
    /**
     * 
     * @param user
     * @return
     */
    public List<Coupon> listCoupon(User user);

    /**
     * 
     * @param user
     * @return
     */
    public List<Coupon> listCreditCoupons(User user);

    /**
     * 
     * @param user
     * @param batchIds
     * @return
     */
    public List<Coupon> listCoupon(User user, List<Long> batchIds);

    /**
     * 
     * @param user
     * @param product
     * @return
     */
    public List<Coupon> listCoupon(User user, Product product);
    
    /**
     * 
     * @param user
     * @param product
     * @return
     */
    public int syncCoupon(User user, Product product);
    
    /**
     * 
     * @param couponBathId
     * @return
     */
    public CouponBatch loadCouponBatch(Long couponBathId);
    
    /**
     * 
     * @param mobile
     * @param couponBatch
     * @return
     */
    public Coupon loadCoupon(String mobile, CouponBatch couponBatch);
    
    /**
     * 
     * @param userId
     * @param couponBatch
     * @return
     */
    public Coupon loadCoupon(Long userId, CouponBatch couponBatch);
    
    /**
     * 
     * @param couponBatch
     * @param mobile
     * @param contactPerson
     * @param wechatNumber
     */
    public Coupon createCoupon(CouponBatch couponBatch, String mobile, String contactPerson, String wechatNumber);
    
    /**
     * 
     * @param coupon
     * @param user
     * @param siteId
     */
    public Order createOrder(Coupon coupon, User user, Long siteId);
    
    /**
     * 
     * @param order
     * @param coupon
     * @return
     */
    public Result payOrder(Order order, Coupon coupon);
    
    /**
     * list coupon from online year order
     * @param order
     * @return
     */
    public List<Coupon> listCoupon(Order order);
    
    /**
     * 
     * @param coupon
     * @param from
     * @param to
     */
    public void give(Coupon coupon, User from, User to);
}
